Repository navigation
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #572 +/- ##
=======================================
Coverage 99.93% 99.93%
=======================================
Files 19 19
Lines 3121 3123 +2
Branches 586 586
=======================================
+ Hits 3119 3121 +2
Misses 1 1
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Author
AI Review Summary
|
8 of 11 tasks
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR speeds up$O(n \log n)$ time and $O(n)$ memory — matching the approach already used in
pingouin.wilcoxonby computing the Common Language Effect Size (CLES) vianp.searchsortedon sortedyinpingouin.compute_effsize(..., eftype="cles")— instead of materializing an(n, n)pairwise difference matrix. Results are numerically identical (0.00e+00max difference), with 2.2x–26x speedups on moderate-to-large samples.Impact rating: P2 — Substantial, benchmarked speedup (up to 26x at$O(n^2) \to O(n)$ memory reduction in a core nonparametric test, with zero behavioral change.
n = 5000) andModel used: Gemini 4 Neon via Antigravity CLI
Benchmarks
Median wall time over repeated runs (integers in
[0, 100)with ties,method="asymptotic"):n = 500(15 runs)n = 5000(5 runs)At
n = 5000, this also avoids allocating the 200 MB temporary(5000, 5000)float64 difference matrix.Benchmark code:
Equivalence
Sorting
yonce and counting strictly smaller and tied entries for eachxvianp.searchsorted(..., side="left")andnp.searchsorted(..., side="right")preserves the exact Vargha–Delaney CLES formula and the1 - clesinversion whenalternative == "less".Checked against the brute-force
np.where(diff == 0, 0.5, diff > 0).mean()reference across 50 randomized inputs with heavy ties for all threealternativevalues ("two-sided","greater","less"):CLES:0.00e+00Verification
alternativevalues intests/test_nonparametric.py.ruff checkandruff format --checkpass cleanly.pytest -q): 171 passed.Checklist
/simplifywas run (preferred, Claude Code) (used Antigravity CLI rather than Claude Code; diff was reviewed for simplicity)